package com.roseski.service;

import java.io.IOException;
import java.util.Date;

import com.alibaba.fastjson.JSONObject;
import com.roseski.dto.OrderListResp;
import com.roseski.dto.OrderReq;
import com.roseski.dto.PageDto;
import com.roseski.dto.ServiceResult;
import com.roseski.model.RoseskiMember;
import com.roseski.model.RoseskiOrder;
import com.roseski.model.RoseskiPayOrder;

public interface RoseskiOrderService {
	
	/**
	 * 创建订单
	 * @param req
	 * @return
	 */
	public RoseskiPayOrder createOrder(OrderReq req, RoseskiMember member);
	
	/**
	 * 更新订单为成功
	 * @param order
	 */
	public void updateSuccessStatus(String payOrderNo, String transactionId, Date payTime) throws IOException;
	
	/**
	 * 查询订单状态
	 * @param order
	 * @return
	 */
	public RoseskiOrder queryOrderByOrderNo(String orderNo);
	
	/**
	 * 
	 * @param memberId
	 * @return
	 */
	public PageDto<OrderListResp> listByMemberId(Long memberId, Integer page, Integer pageSize) throws IOException;
	
	/**
	 * 更新已领取
	 * @param orderNo
	 * @return
	 */
	public ServiceResult<String> updateReceiveStatus(String orderNo);
	
	/**
	 * 获取卡券信息
	 * @param orderNo
	 * @return
	 */
	public ServiceResult<JSONObject> getCardMessage(String orderNo) throws IOException;

}
